import React from 'react';
import TableChart from './TableChart';
import * as ACTIONS from '../../../actions/retained/studentMissionRetainedAction';

export default class StudentRetainedTableChart extends TableChart {
	constructor(props) {
		super(props);
	}

	getHeaderColumns(props) {
		let { cycle, cycleUnit, type } = props;
		let headers = [
			{
				label: '首次使用时间',
				dataIndex: 0,
				dataKey: null,
				width: 80
			},
			{
				label: '当天闯关人数',
				dataIndex: 1,
				dataKey: 'count',
				width: 92
			}
		];

		for (let i = 0; i < cycle; i++) {
			headers.push({
				label: `${(i + 1)}${cycleUnit}`,
				dataIndex: (i + 2),
				dataKey: type == ACTIONS.TypeOption.RATE ? 'rate' : 'count'
			})
		}

		return headers;
	}
}
